package com.atjg.autocat

import com.atjg.autocat.bean.BannerBean
import com.atjg.autocat.bean.DeliverInfo
import com.atjg.autocat.bean.DeviceInfo
import com.atjg.autocat.bean.GoodBean
import com.atjg.autocat.bean.OrderBean
import com.atjg.autocat.bean.PortBean
import com.atjg.autocat.bean.UpImgBean
import com.atjg.autocat.bean.UserBean
import com.zhy.baselibrary.base.BaseData
import okhttp3.MultipartBody
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.Part
import retrofit2.http.Query
import retrofit2.http.Url

interface UrlApi {

    @GET("autowash/goods/getListByDeviceId")
    suspend fun queryGoods(@Query("deviceId") deviceId: String): BaseData<List<GoodBean>>

    @GET("autowash/banner/getBanner")
    suspend fun queryBanner(): BaseData<List<BannerBean>>

    @Multipart
    @POST("autowash/uploud/uploudImage")
    suspend fun uploadImg(
        @Part imgs: MultipartBody.Part,
        @Part("orderNo") orderNo: RequestBody
    ): BaseData<Any>

    @GET("autowash/combo/getCombo")
    suspend fun queryCombo(@Query("deviceId") deviceId: String): BaseData<List<GoodBean>>


    @POST("api/Device/Add")
    suspend fun login(@Body body: RequestBody): BaseData<String>

    @GET("api/News/GetSlide")
    suspend fun banner(): BaseData<List<String>>

    //获取openid
    @GET("api/WxUser/GetUserInfo")
    suspend fun queryOpenId(@Query("keyWord") keyWord: String): BaseData<String>

    //获取学号
    @GET("api/Student/Detail")
    suspend fun queryXueHao(@Query("id") id: String): BaseData<Any>

    //获取openid
    @GET("api/WxUser/Detail")
    suspend fun queryPhone(@Query("id") id: String): BaseData<UserBean>


    @GET("autowash/order/getOrderEntity")
    suspend fun queryOrderStatus(@Query("orderNo") orderNo: String): BaseData<OrderBean>


    @GET("autowash/v3/nativePay")
    suspend fun queryNativePay(@Query("id") openId: String): BaseData<OrderBean>

    @Multipart
    @POST("fileServer/api/File/UploadFile")
    suspend fun upImg(@Part imgs: MultipartBody.Part): BaseData<UpImgBean>

    @Multipart
    @POST("api/File/UploadFile")
    suspend fun upNewImg(@Part imgs: MultipartBody.Part): BaseData<UpImgBean>

    @GET("api/FillPort/getFillPortList")
    suspend fun queryPortList(): BaseData<List<PortBean>>

    @GET("api/Device/getDetail")
    suspend fun queryCategoryDetail(): BaseData<PortBean>

    @GET("api/Category/Detail")
    suspend fun queryPortDetail(@Query("id") keyWord: String): BaseData<PortBean>

    @POST("api/Delivery/Add")
    suspend fun submit(@Body body: RequestBody): BaseData<DeliverInfo>

    @POST("api/Delivery/Add2")
    suspend fun xueHaoSubmit(@Body body: RequestBody): BaseData<DeliverInfo>

    @POST("api/FillPort/Edit")
    suspend fun fillPort(@Body body: RequestBody): BaseData<Any>

    //嘉森更新箱体是否满溢
    @GET("api/device/updateFullState")
    suspend fun updateFullState(@Query("fullState") fullState: String): BaseData<Any>


    //其他更新箱体是否满溢
    @GET("api/FillPort/updateFullState")
    suspend fun updateFull(
        @Query("id") keyWord: String,
        @Query("fullState") fullState: String
    ): BaseData<Any>

    //提交订单
    @POST("api/WxOrder/Add")
    suspend fun submitOrder(@Body body: RequestBody): BaseData<String>

    //提交订单
    @POST("api/WxOrder/Edit")
    suspend fun submitOrderError(@Body body: RequestBody): BaseData<Any>

    @GET("api/Home/getVersion")
    suspend fun queryVersion(): BaseData<Any>

    @GET("api/Ad/GetAdList")
    suspend fun queryAd(): BaseData<List<DeviceInfo>>

    @GET("api/Device/getDetail")
    suspend fun queryDeviceInfo(): BaseData<DeviceInfo>

    //绑定ic卡
    @POST("api/WxUser/BindUserIc")
    suspend fun bindUserICCard(@Body body: RequestBody): BaseData<String>

    //绑定指纹
    @POST("api/UserFinger/Add")
    suspend fun bindUserFinger(@Body body: RequestBody): BaseData<String>

    //查询指纹列表
    @GET("api/UserFinger/GetFingerList")
    suspend fun queryFingerList(): BaseData<List<DeviceInfo>>

    //查询指纹列表
    @GET("api/Device/updateSmokeState")
    suspend fun updateSmokeState(@Query("smokeState") smokeState: String): BaseData<Any>

    //上传人脸图片
    @Multipart
    @POST("face/UploadFile")
    suspend fun uploadFaceFile(
        @Part imgs: MultipartBody.Part,
        @Part("openId") openId: RequestBody,
        @Part("platForm") platForm: RequestBody,
    ): BaseData<UpImgBean>

    //验证人脸
    @Multipart
    @POST("face/faceOCR2")
    suspend fun verifyFaceFile(
        @Part imgs: MultipartBody.Part,
        @Query("platForm") platForm: String
    ): BaseData<String>


    @GET("api/Device/updateQymState")
    suspend fun updateQymState(
        @Query("state") state: String
    ): BaseData<Any>

    @GET("api/Device/updateTdmState")
    suspend fun updateTdmState(
        @Query("state") state: String
    ): BaseData<Any>

    @POST("api/Device/updateState")
    suspend fun updateState(
        @Body body: RequestBody
    ): BaseData<Any>





}